<template>
  <v-carousel cycle height="200" hide-delimiter-background show-arrows-on-hover>
    <v-carousel-item
      v-for="(ad, i) in ads"
      :key="i"
      :src="ad.pic"
      :link="true"
      :href="ad.url"
      target="_blank"
    ></v-carousel-item>
  </v-carousel>
</template>

<script>
import request from '@/request';

export default {
  data() {
    return {
      ads: []
    };
  },
  created() {
    request.get('/marketing/advertise', { params: { status: 1 } }).then(ads => {
      this.ads = ads;
    });
  }
};
</script>
